#pragma once
#include "EpilValueObject.h"


class EpilNilObject;
class EpilBooleanObject;
class EpilStringObject;


class EpilNumberObject : public EpilValueObject
{
	EPIL_OBJECT_DECL( Number );

public:
	EpilNumberObject( EpilInterpreter * interpreter, double value );
	virtual ~EpilNumberObject();

	double								GetValue() const								{ return m_value; }

	EpilObject *						OperateUnary( EpilUnaryOperator op );
	EpilObject *						OperateBinary( EpilBinaryOperator op, EpilObject * that );

	bool								operator==( double rhs ) const;
	bool								operator==( const EpilObject & rhs ) const;
	bool								operator==( const EpilNumberObject & rhs ) const;

	virtual EpilValueObject *			Clone() const;
	virtual tstring						ToString() const;

private:
	EpilObject *						OperateBinaryInternal( EpilBinaryOperator op, EpilNilObject * that );
	EpilObject *						OperateBinaryInternal( EpilBinaryOperator op, EpilBooleanObject * that );
	EpilObject *						OperateBinaryInternal( EpilBinaryOperator op, EpilNumberObject * that );
	EpilObject *						OperateBinaryInternal( EpilBinaryOperator op, EpilStringObject * that );

	double								m_value;
};
